import { request } from "@/utils/request"
const prefix = '/maintenance'

export interface maintenanceParams {
	id: number,
	notes: number,
	createAt: string,
	picture: string
	cost: number
}
/**
 * 添加维修记录
 * @param params 
 * @returns 
 */
export const addMaintenanceRequest = (params: maintenanceParams) => {
	return request.post(`${prefix}/addMaintenance`, params)
}

/**
 * 获取维修记录
 * @returns 
 */
export const getMaintenanceRequest = () => {
	return request.get(`${prefix}/getMaintenance`)
}

/**
 * 删除维修记录
 * @param id 
 * @returns 
 */
export const deleteMaintenancRequest = (id: number) => {
	return request.delete(`${prefix}/deleteMaintenance/${id}`)
}

/**
 * 修改维修记录
 * @param params 
 * @returns 
 */
export const reviseMaintenanceRequest = (params: maintenanceParams) => {
	return request.put(`${prefix}/reviseMaintenance`, params)
}